//
//  UserInfo.m
//  Pai9
//
//  Created by Zhou Tao on 10-4-19.
//  Copyright 2010 Free. All rights reserved.
//

#import "UserInfo.h"


@implementation UserInfo

@synthesize score;
@synthesize uname;

-(void) encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:uname forKey:KeyName];
	[aCoder encodeInt:score forKey:KeyScore];
	
}
-(id) initWithCoder:(NSCoder *)aDecoder
{
	if(self = [super init])
	{
		self.uname = [aDecoder decodeObjectForKey:KeyName];
		self.score = [aDecoder decodeIntForKey:KeyScore];
	}
	return self;
}

-(id)copyWithZone:(NSZone*)zone
{
	UserInfo *cp = [[[self class] allocWithZone:zone]init];
	cp.uname = [self.uname copy];
	cp.score = self.score;
	return cp;	//no release or else it'll be released before use.
}
@end
